<template>
  <div id="banner">
    <van-swipe :autoplay="3000">
      <van-swipe-item v-for="image in images" :key="image.id">
        <img :src="image.img" />
      </van-swipe-item>
    </van-swipe>
  </div>
</template>


<script>
import {getbanner} from "../request/app";
export default {
  data() {
    return {
        images: []
    };
  },
  mounted(){
      getbanner().then(val=>{
          if(val.code!=200){
              alert(val.msg);
              return;
          };
          this.images = val.list;
      })
  }
};
</script>


<style scoped>
#banner{
  margin: 20px auto;
}
</style>